export default {
    state: {
        // 先判断是否存在 若存在则转化为对象 不存在则为空
        userInfo: (localStorage.getItem("loginData") && JSON.parse(localStorage.getItem("loginData"))) || {}
    },
    mutations: {
        setUserInfo(state, uInfo) {
            state.userInfo = uInfo
        }
    }
}